import groovy.sql.Sql

public class Main {
	static main(args) {
		def url = 'jdbc:mysql://127.0.0.1:3306/demo?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false'
		def user = 'root'
		def password = 'root'
		def driver = 'com.mysql.jdbc.Driver'
		
		Sql.withInstance(url, user, password, driver) { sql ->
			println sql.connection.catalog
		}
		
	}
}
